<%@page import="org.amj.wn.Property"%>
<%@page import="org.amj.wn.UIElement"%>
<%@page import="org.amj.wn.WNUserService"%>
<%@page import="org.amj.wn.WaqfeNau"%>
<%@page import="org.amj.wn.SchemaItem"%>
<%@page import="java.util.List"%>
<%@page import="org.amj.wn.ObjectSchema"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<title>Edit</title>
<link type="text/css" rel="stylesheet" href="/stylesheets/main.css" />
</head>
<body>
	<jsp:include page="sectcommon.jsp"></jsp:include>
	<form method="post" action="/sect/WaqfeNouServiceOperationsForSect">
		<%
			int pageNumber = 1;
			String memberCode = request.getParameter("wn");
			WaqfeNau wn = WaqfeNau.get(memberCode);
			if (wn == null) {
				response.sendRedirect("/sect/menu.jsp?r=1");
			} else {
				%>
				<div class="menu">
				<%
					
					try{
						pageNumber = Integer.parseInt(request.getParameter("_pn"));	
					}catch(Exception exp){}
					
				
					List<SchemaItem> models = WaqfeNau.getSchema().getModels();
					int currPage = 1;
		
					for (SchemaItem model : models) {
						if(model.getUiElement() == UIElement.PAGE) {
							if(currPage == pageNumber) {
								out.append(model.getRenderer().render(wn));
							} else {
								%><a href='?_pn=<%=currPage%>&wn=<%=memberCode %>'><%
								out.append(model.getRenderer().render(wn));
								%></a><%
							}
							currPage++;
						}
					}
				%>
			</div>
		<%
				currPage = 0;

				for (SchemaItem model : models) {
					if(model.getUiElement() != UIElement.PAGE) {
						if(currPage == pageNumber) {
							out.append(model.getRenderer().render(wn));
						}
						
					} else {
						currPage++;
					}
				}
			}
		%>
		<input name='_pn' type='hidden' value='<%=pageNumber%>' /> 
		<input name='<%=Property.memberCode%>' type='hidden' value='<%=memberCode%>' /> 
		<input name='opt' class='input_text' type='hidden' value='MODIFY' /> 
		<input type='submit' value='Update' class="input_button" />
	</form>
</body>
</html>
